import time

def buble(mas):
      swap = True
      while swap:
            swap = False
            for r  in range(len(mas) -1):
                  if int(mas[r]) > int(mas[r+1]):
                        mas[r],mas[r+1] = mas[r+1],mas[r]
                        swap = True
      return mas
def tS(mas):
      t_start = time.time()
      w = buble(mas)
      t_finish = time.time()
      print("Время", round((t_finish-t_start)) * 1000, 'мc')


Op = open ('m3_shuffle.txt')
Op1 = open('m1_sorted.txt')
Op2 = open('m2_reverse.txt')
array = Op.readlines()
array1 = Op1.readlines()
array2 = Op2.readlines()
tS(array)
tS(array1)
tS(array2)
